Fix HVM booting through Xen-API when the kernel is unspecified.
authorEwan Mellor <ewan@xensource.com>
Wed, 27 Dec 2006 00:38:01 +0000 (00:38 +0000)
committerEwan Mellor <ewan@xensource.com>
Wed, 27 Dec 2006 00:38:01 +0000 (00:38 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/XendDomainInfo.py
tools/python/xen/xend/image.py

index 6bd11899b67209d518002a26559604a701e5acc3..e66bf89915a738e0141d6ade5f6040436d8d564e 100644 (file)
@@ -1555,6 +1555,8 @@ class XendDomainInfo:
         if boot:
             # HVM booting.
             self.info['image']['type'] = 'hvm'
+            if not 'devices' in self.info['image']:
+                self.info['image']['devices'] = {}
             self.info['image']['devices']['boot'] = boot
         elif not blexec and kernel:
             # Boot from dom0.  Nothing left to do -- the kernel and ramdisk
index d3876e27492071384dc68db0d5757111aa331e9d..d4c475c37178550a3850ec5e392e724cf66bef5d 100644 (file)
@@ -312,6 +312,9 @@ class HVMImageHandler(ImageHandler):
     def configure(self, vmConfig, imageConfig, deviceConfig):
         ImageHandler.configure(self, vmConfig, imageConfig, deviceConfig)
 
+        if not self.kernel:
+            self.kernel = '/usr/lib/xen/boot/hvmloader'
+
         info = xc.xeninfo()
         if 'hvm' not in info['xen_caps']:
             raise VmError("HVM guest support is unavailable: is VT/AMD-V "